package com.luyuan.crm.sale.model;

public enum PaymentType {
    CASH_ON_DELIVERY(1, "代收货款"), ALIPAY(2, "支付宝支付"), BANK_TRANSFER(3, "银行到款"), CASH(4, "现金结算"), TO_SEND(5, "产品补寄");
    int index;

    String name;

    private PaymentType(int index, String name) {
        this.index = index;
        this.name = name;
    }

    public static PaymentType valueOf(int index) {
        PaymentType payMethodType = null;
        switch (index) {
        case 1:
            payMethodType = PaymentType.CASH_ON_DELIVERY;
            break;
        case 2:
            payMethodType = PaymentType.ALIPAY;
            break;
        case 3:
            payMethodType = PaymentType.BANK_TRANSFER;
            break;
        case 4:
            payMethodType = PaymentType.CASH;
            break;
        default:
            payMethodType = null;
            break;
        }
        return payMethodType;
    }

    public int value() {
        return this.index;
    }

    public String getName() {
        return this.name;
    }
}
